BIN=code
CC=gcc
SRC=$(wildcard *.c)#获取.c的文件
OBJ=$(SRC:.c=.o)
LFLAGS=-o
CFLAGS=-c
RM=rm -f

$(BIN):$(OBJ)
	@$(CC) $(LFLAGS) $@ $^
	@echo "链接...$^ 到 $@	"
%.o:%.c
	@$(CC) $(CFLAGS) $<
	@echo "编译...$< 到 $@"
.PHONY:clean
clean:	
	$(RM) $(OBJ) $(BIN)
.PHONY:text
text:
	@./$(BIN)
